<?php
/**
 * Created by PhpStorm.
 * User: dumbledore
 * Date: 2018/3/21
 * Time: 下午5:16
 */
?>

<!DOCTYPE html>
<html>
<head>
    <!--[if lt IE 7]>
    <div class="ie6_error">还在用<strong>漏洞百出的IE6浏览器</strong>么？为了您的网络安全，请升级浏览器 <a target="_blank"
                                                                               href="http://browsehappy.com">立即升级</a>
    </div>
    <![endif]-->

    <meta charset="utf-8">
    <title>申请账期用户-文具1号</title>
    <meta name="description"
          content="文具1号作为上海办公用品供货商公司,专为世界500强企业及SOHO办公族提供网上商城一站式办公耗材批发及采购服务,一站式选购办公日用文具用品,厂家直销,好货又便宜【阳光采购就上文具1号 阳光价格 老板放心 品质保障 员工省力】"/>
    <meta name="keywords" content="办公用品,办公文具,办公文具网站,文具网站,办公用品网,文具采购网,金万年"/>
    <meta name="copyright" content="上海易推信息科技有限公司"/>
    <meta name="renderer" content="webkit">
    <base href="<?php echo base_url(); ?>"/>
    <link rel="shortcut icon" href="favicon.ico"/>
    <link rel="stylesheet" href="public/js/layui/css/layui.css">
    <link rel="stylesheet" type="text/css" href="public/css/base.css"/>
    <link rel="stylesheet" type="text/css" href="public/css/common.css"/>
    <link href="public/css/city-picker.css" rel="stylesheet">
    <link rel="stylesheet" type="text/css" href="public/css/index.css"/>
    <!--[if lte IE 9]>
    <script type="text/javascript" src="public/js/html5shiv-printshiv-3.js"></script>
    <![endif]-->
</head>
<body>
<div class="bg bg-fff">
    <!--common - head -->
    <?php $this->load->view('common/header.php'); ?>
    <!--common - head end-->

    <div class="container">
        <div class="workbench-container">
            <div class="workbench-detail-container">
                <p class="path-tit">
                    <a href="javascript:;" class="color-red">工作台</a>＞我的资料
                    <?php if ($account_period_apply['verify_status'] == 2) { ?>
                        <span class="path-tit-states">原因：<em
                                    class="color-red"><?php echo $account_period_apply['reason'] ?></em></span>
                    <?php } ?>
                    <span class="path-tit-states">状态：<em
                                class="color-red"><?php echo $account_period_apply['verify_status'] == 2 ? '审核不通过' : '审核中'; ?></em></span>
                </p>

                <div class="workbench-detail-box-wrapper">
                    <form class="layui-form workbench-detail-form" method="post">

                        <div class="workbench-detail-box workbench-detail-box2 workbench-detail-box-jbzl">
                            <p class="workbench-detail-tit">
                                基本资料
                                <a href="javascript:;"
                                   class="icon workbench-detail-btn-up bg-btn_opentip bg-btn_Shuttip">查看更多</a>
                            </p>
                            <div class="workbench-detail-cont">
                                <div class="apply-payment-box">
                                    <div class="layui-form-item">
                                        <label class="layui-form-label">企业名称：</label>
                                        <div class="layui-input-block">
                                            <input type="text"
                                                   id="name"
                                                   name="name" <?php if ($account_period_apply['verify_status'] == 0) { ?> readonly <?php } ?>
                                                   autocomplete="off" placeholder="请输入工商执照上的企业名称" lay-verify="required"
                                                   value="<?php echo $company_info['name']; ?>" class="layui-input">
                                        </div>
                                    </div><!--企业名称-->

                                    <?php if ($account_period_apply['verify_status'] == 2) { ?>
                                        <div class="layui-form-item">
                                            <label class="layui-form-label">企业所在地：</label>
                                            <div class="layui-input-block">
                                                <div class="city-box">
                                                    <div id="distpicker1">
                                                        <div class="form-group">
                                                            <div style="position: relative;">
                                                                <input id="city-picker1" class="form-control" readonly
                                                                       autocomplete="off" type="text" value="请选择省/市/区"
                                                                       data-toggle="city-picker">
                                                            </div>
                                                        </div>
                                                    </div>
                                                </div>
                                                <input type="text" name="address" required placeholder="请输入详细地址"
                                                       id="address" autocomplete="off"
                                                       value="<?php echo $company_info['address']; ?>"
                                                       class="layui-input">
                                            </div>
                                        </div><!--企业所在地-->
                                    <?php } else { ?>

                                        <div class="layui-form-item">
                                            <label class="layui-form-label">所在地区：</label>
                                            <div class="layui-input-block">
                                                <?php if ($account_period_apply['verify_status'] == 0): ?>
                                                    <div class="city-box">
                                                        <input type="text" name="address" autocomplete="off" readonly
                                                               value="<?php echo $company_info['province']; ?>/<?php echo $company_info['city']; ?>/<?php echo $company_info['district']; ?>"
                                                               class="layui-input">
                                                    </div>
                                                <?php else:; ?>
                                                    <div class="city-box">
                                                        <div class="form-group">
                                                            <div style="position: relative;">
                                                                <input id="city-picker1" readonly class="form-control"
                                                                       disabled
                                                                       dd="<?php echo $account_period_apply['verify_status']; ?>"
                                                                       type="text" autocomplete="off"
                                                                       value="<?php echo $company_info['province']; ?>/<?php echo $company_info['city']; ?>/<?php echo $company_info['district']; ?>">
                                                            </div>
                                                        </div>
                                                    </div>
                                                <?php endif; ?>
                                                <input type="text" name="address" required placeholder="请输入详细地址"
                                                       autocomplete="off" readonly
                                                       value="<?php echo $company_info['address']; ?>"
                                                       class="layui-input">

                                            </div>
                                        </div>
                                        <!--企业所在地-->

                                    <?php } ?>

                                    <?php if ($account_period_apply['verify_status'] == 2) { ?>
                                        <div class="layui-form-item">
                                            <label class="layui-form-label">营业执照：</label>
                                            <div class="layui-input-block">
                                                <div class="file-box">
                                                    <div class="layui-upload input-business-license bg-icon_addphoto_n">
                                                        <button type="button" class="layui-btn" id="test1">上传图片</button>
                                                        <div class="layui-upload-list">
                                                            <img class="layui-upload-img" id="demo1"
                                                                 src="<?php echo $company_info['business_license_pic_path'] ? $this->config->item("upload_url") . $company_info['business_license_pic_path'] : ''; ?>">
                                                            <!--<p id="demoText"></p>-->
                                                        </div>
                                                    </div>
                                                </div>
                                                <p class="file-p">请上传原件彩色照片；图片尺寸最大不超过5M</p>
                                            </div>
                                        </div><!--上传营业执照-->

                                    <?php } else { ?>
                                        <div class="layui-form-item">
                                            <label class="layui-form-label">营业执照：</label>
                                            <div class="layui-input-block">
                                                <div class="file-box">
                                                    <div class="layui-upload input-business-license bg-icon_addphoto_n">
                                                        <div class="layui-upload-list">
                                                            <img class="layui-upload-img"
                                                                 src="<?php echo $company_info['business_license_pic_path'] ? $this->config->item("upload_url") . $company_info['business_license_pic_path'] : ''; ?>">
                                                        </div>
                                                    </div>
                                                </div>
                                            </div>
                                        </div><!--只能看-->

                                    <?php } ?>


                                    <?php if ($account_period_apply['verify_status'] == 2) { ?>
                                        <script>
                                            $(function () {
                                                layui.use(['form', 'layedit', 'laydate', 'upload'], function () {
                                                    var form = layui.form
                                                        , layer = layui.layer
                                                        , layedit = layui.layedit;
                                                    var $ = layui.jquery
                                                        , upload = layui.upload;

                                                    form.on('radio(type)', function (data) {
                                                        if (data.value == '营业执照注册号') {
                                                            $("#change_cc").val('');
                                                            $("#change_cc").css('display', 'none');
                                                            $("#change_bln").css('display', 'block');
                                                        } else {
                                                            $("#change_bln").val('');
                                                            $("#change_bln").css('display', 'none');
                                                            $("#change_cc").css('display', 'block');
                                                        }
                                                    });
                                                });

                                                // $(document).on('click', $('#shtyxydm').next('.layui-form-radio'),function(){
                                                //     alert('3');
                                                //     $("#change_bln").val('');
                                                //     $("#change_bln").css('display', 'none');
                                                //     $("#change_cc").css('display', 'block');
                                                // });
                                                // $(document).on('click', $('#yyzzzch').next('.layui-form-radio'),function(){
                                                //     alert('2');
                                                //     $("#change_cc").val('');
                                                //     $("#change_cc").css('display', 'none');
                                                //     $("#change_bln").css('display', 'block');
                                                // });
                                            })
                                        </script>
                                    <?php if (!$company_info['business_license_number']): ?>
                                        <div class="layui-form-item">
                                            <label class="layui-form-label">营业执照注册号：</label>
                                            <div class="layui-input-block apply-payment-radio-box">
                                                <input type="radio" name="sex" id="shtyxydm" value="统一社会信用代码"
                                                       lay-filter="type"
                                                       title="统一社会信用代码" checked>
                                                <input type="radio" name="sex" id="yyzzzch" value="营业执照注册号"
                                                       lay-filter="type"
                                                       title="营业执照注册号">
                                            </div>
                                            <div class="layui-input-block">
                                                <input type="text" id="change_cc" required name="credit_code"
                                                       placeholder="请输入统一社会信用代码" autocomplete="off" lay-filter="type"
                                                       value="<?php echo $company_info['credit_code']; ?>"
                                                       class="apply-payment-input layui-input">
                                                <input style="display: none;" type="text" id="change_bln" required
                                                       name="business_license_number" placeholder="营业执照注册号"
                                                       autocomplete="off" value="" lay-filter="type"
                                                       class="apply-payment-input layui-input">
                                            </div>
                                        </div>
                                        <!--营业执照注册号-->
                                    <?php else: ?>
                                        <div class="layui-form-item">
                                            <label class="layui-form-label" id="zch-div">注册号：</label>
                                            <div class="layui-input-block apply-payment-radio-box">
                                                <input type="radio" name="sex" id="shtyxydm" value="统一社会信用代码"
                                                       lay-filter="type"
                                                       title="统一社会信用代码">
                                                <input type="radio" name="sex" id="yyzzzch" value="营业执照注册号"
                                                       lay-filter="type"
                                                       title="营业执照注册号" checked>
                                            </div>
                                            <div class="layui-input-block">
                                                <input style="display: none;" type="text" id="change_cc" required
                                                       name="credit_code" placeholder="请输入统一社会信用代码" autocomplete="off"
                                                       lay-filter="type"
                                                       value="" class="apply-payment-input layui-input">
                                                <input type="text" id="change_bln" required
                                                       name="business_license_number" placeholder="营业执照注册号"
                                                       autocomplete="off" lay-filter="type"
                                                       value="<?php echo $company_info['business_license_number']; ?>"
                                                       class="apply-payment-input layui-input">
                                            </div>
                                        </div><!--营业执照注册号-->
                                    <?php endif; ?>
                                    <?php } else { ?>
                                        <?php if (!$company_info['business_license_number']): ?>
                                        <div class="layui-form-item"><label class="layui-form-label"
                                                                            id="zch-div">注册号：</label>
                                            <div class="layui-input-block apply-payment-radio-box"><input type="radio"
                                                                                                          name="sex"
                                                                                                          lay-filter="type"
                                                                                                          id="shtyxydm"
                                                                                                          value="统一社会信用代码"
                                                                                                          title="统一社会信用代码"
                                                                                                          checked
                                                                                                          disabled="disabled"><input
                                                        type="radio" name="sex" id="yyzzzch" value="营业执照注册号"
                                                        lay-filter="type"
                                                        title="营业执照注册号" disabled="disabled"></div>
                                            <div class="layui-input-block">
                                                <input type="text" id="change_cc" required name="credit_code"
                                                       placeholder="请输入统一社会信用代码" autocomplete="off"
                                                       value="<?php echo $company_info['credit_code']; ?>" readonly
                                                       disabled class="apply-payment-input layui-input">
                                                <input style="display: none;" type="text" id="change_bln" required
                                                       name="business_license_number" placeholder="营业执照注册号"
                                                       autocomplete="off" readonly disabled value=""
                                                       class="apply-payment-input layui-input">
                                            </div>
                                        </div><!--营业执照注册号-->
                                    <?php else: ?>
                                        <div class="layui-form-item">
                                            <label class="layui-form-label" id="zch-div">注册号：</label>
                                            <div class="layui-input-block apply-payment-radio-box"><input type="radio"
                                                                                                          name="sex"
                                                                                                          id="shtyxydm"
                                                                                                          value="统一社会信用代码"
                                                                                                          disabled="disabled"
                                                                                                          title="统一社会信用代码">
                                                <input type="radio" name="sex" id="yyzzzch" value="营业执照注册号"
                                                       disabled="disabled" title="营业执照注册号" checked>
                                            </div>
                                            <div class="layui-input-block">
                                                <input style="display: none;" type="text" id="change_cc" required
                                                       disabled name="credit_code" placeholder="请输入统一社会信用代码"
                                                       autocomplete="off" readonly value=""
                                                       class="apply-payment-input layui-input">
                                                <input type="text" id="change_bln" required disabled
                                                       name="business_license_number" placeholder="营业执照注册号"
                                                       autocomplete="off" readonly
                                                       value="<?php echo $company_info['business_license_number']; ?>"
                                                       class="apply-payment-input layui-input">
                                            </div>
                                        </div>
                                        <!--营业执照注册号-->
                                    <?php endif; ?>
                                    <?php } ?>


                                    <div class="layui-form-item">
                                        <label class="layui-form-label">企业性质：</label>
                                        <div class="layui-input-block row">
                                            <select <?php if ($account_period_apply['verify_status'] == 0): ?> disabled <?php endif; ?>
                                                    name="type" lay-filter="qyxz" lay-verify="required">
                                                <option value="">请选择企业性质</option>
                                                <option value="1" <?php if ($company_info['type'] == 1) { ?> selected="selected" <?php } ?> >
                                                    政府机关、事业单位
                                                </option>
                                                <option value="2" <?php if ($company_info['type'] == 2) { ?> selected="selected" <?php } ?> >
                                                    私营
                                                </option>
                                                <option value="3" <?php if ($company_info['type'] == 3) { ?> selected="selected" <?php } ?> >
                                                    国营
                                                </option>
                                                <option value="4" <?php if ($company_info['type'] == 4) { ?> selected="selected" <?php } ?> >
                                                    合资
                                                </option>
                                                <option value="5" <?php if ($company_info['type'] == 5) { ?> selected="selected" <?php } ?> >
                                                    外资
                                                </option>
                                                <option value="6" <?php if ($company_info['type'] == 6) { ?> selected="selected" <?php } ?> >
                                                    其他
                                                </option>
                                            </select>
                                        </div>
                                    </div><!--企业性质-->
                                    <div class="layui-form-item">
                                        <label class="layui-form-label">企业人数：</label>
                                        <div class="layui-input-block row">
                                            <select <?php if ($account_period_apply['verify_status'] == 0): ?> disabled <?php endif; ?>
                                                    name="number" lay-filter="qyxz" lay-verify="required">
                                                <option value="">请选择企业人数</option>
                                                <option value="1" <?php if ($company_info['number'] == 1): ?> selected="selected" <?php endif; ?> >
                                                    1-49
                                                </option>
                                                <option value="2" <?php if ($company_info['number'] == 2): ?> selected="selected" <?php endif; ?> >
                                                    50-99
                                                </option>
                                                <option value="3" <?php if ($company_info['number'] == 3): ?> selected="selected" <?php endif; ?> >
                                                    100-499
                                                </option>
                                                <option value="4" <?php if ($company_info['number'] == 4): ?> selected="selected" <?php endif; ?> >
                                                    500-999
                                                </option>
                                                <option value="5" <?php if ($company_info['number'] == 5): ?> selected="selected" <?php endif; ?> >
                                                    1000以上
                                                </option>
                                            </select>
                                        </div>
                                    </div><!--企业人数-->
                                    <div class="layui-form-item">
                                        <label class="layui-form-label">所属行业：</label>
                                        <div class="layui-input-block row">
                                            <select <?php if ($account_period_apply['verify_status'] == 0): ?> disabled <?php endif; ?>
                                                    name="industry" lay-filter="qyxz" lay-verify="required">
                                                <option value="">请选择行业</option>
                                                <option value="1" <?php if ($company_info['number'] == 1): ?> selected="selected" <?php endif; ?> >
                                                    IT、互联网、科技
                                                </option>
                                                <option value="2" <?php if ($company_info['number'] == 2): ?> selected="selected" <?php endif; ?> >
                                                    金融、证券、保险
                                                </option>
                                                <option value="3" <?php if ($company_info['number'] == 3): ?> selected="selected" <?php endif; ?> >
                                                    房地产、建筑、工程
                                                </option>
                                                <option value="4" <?php if ($company_info['number'] == 4): ?> selected="selected" <?php endif; ?> >
                                                    广告、创意、设计
                                                </option>
                                                <option value="5" <?php if ($company_info['number'] == 5): ?> selected="selected" <?php endif; ?> >
                                                    教育、文化、艺术
                                                </option>
                                                <option value="6" <?php if ($company_info['number'] == 6): ?> selected="selected" <?php endif; ?> >
                                                    其他
                                                </option>
                                            </select>
                                        </div>
                                    </div><!--所属行业-->
                                    <div class="layui-form-item">
                                        <label class="layui-form-label">办公电话：</label>
                                        <div class="layui-input-block">
                                            <input type="text" <?php if ($account_period_apply['verify_status'] == 0): ?> disabled <?php endif; ?>
                                                   id="phone" name="phone" required lay-verify="required"
                                                   placeholder="包括区号、电话、分机号，以“-”隔开"
                                                   value="<?php echo $company_info['phone']; ?>" autocomplete="off"
                                                   class="layui-input">
                                        </div>
                                    </div><!--联系方式-->
                                </div>

                            </div>
                        </div>  <!--企业信息-->

                        <div class="workbench-detail-box workbench-detail-box2 workbench-detail-box-jbzl">
                            <p class="workbench-detail-tit">
                                审核资料
                                <a href="javascript:;" class="icon workbench-detail-btn-up bg-btn_opentip">查看更多</a>
                            </p>
                            <div class="workbench-detail-cont">
                                <div class="apply-payment-box">
                                    <div class="layui-form-item">
                                        <label class="layui-form-label">合同签订人：</label>
                                        <div class="layui-input-block">
                                            <input <?php if ($account_period_apply['verify_status'] == 0): ?> disabled <?php endif; ?>
                                                    id="contractor" type="text" name="contractor" required
                                                    placeholder="请输入真实姓名"
                                                    value="<?php echo $company_info['contractor']; ?>"
                                                    autocomplete="off" class="layui-input" lay-verify="required">
                                        </div>
                                    </div><!--企业名称-->
                                    <div class="layui-form-item">
                                        <label class="layui-form-label">合同签订人电子邮箱：</label>
                                        <div class="layui-input-block">
                                            <input <?php if ($account_period_apply['verify_status'] == 0): ?> disabled <?php endif; ?>
                                                    type="email"
                                                    id="email" name="email" required lay-verify="email"
                                                    value="<?php echo $company_info['email']; ?>" placeholder="请输入电子邮箱 "
                                                    autocomplete="off" class="layui-input">
                                        </div>
                                    </div><!--合同签订人电子邮箱-->
                                    <div class="layui-form-item">
                                        <label class="layui-form-label">联系人手机：</label>
                                        <div class="layui-input-block">
                                            <input id="tel" <?php if ($account_period_apply['verify_status'] == 0): ?> disabled <?php endif; ?>
                                                   data-id="tel" type="text" value="<?php echo $company_info['tel']; ?>"
                                                   name="tel"
                                                   maxlength="11" required
                                                   lay-verify="required|phone" placeholder="请输入联系人手机 "
                                                   autocomplete="off" class="layui-input">
                                        </div>
                                    </div><!--联系人手机-->
                                    <?php if ($account_period_apply['verify_status'] == 2) { ?>
                                        <div class="layui-form-item">
                                            <label class="layui-form-label">短信验证码：</label>
                                            <div class="layui-input-block">
                                                <input type="text" name="code" value="" required
                                                       id="code" lay-verify="code|required"
                                                       maxlength="6" placeholder="请输入6位数验证码 " autocomplete="off"
                                                       class="layui-input">
                                                <!--<a href="javascript:;" class="send-code">发送验证码</a>-->
                                                <input type="button" class="send-code send-code-gray"
                                                       onclick="sendCode(this)" value="点击发送验证码"/>
                                            </div>
                                        </div><!--联系人手机-->
                                    <?php } ?>
                                    <div class="layui-form-item">
                                        <label class="layui-form-label">身份证号码：</label>
                                        <div class="layui-input-block">
                                            <input type="text" <?php if ($account_period_apply['verify_status'] == 0): ?> disabled <?php endif; ?>
                                                   id="id_card_no" value="<?php echo $company_info['id_card_no']; ?>"
                                                   name="id_card_no"
                                                   required lay-verify="identity"
                                                   placeholder="请输入二代身份证号码 " autocomplete="off" class="layui-input">
                                        </div>
                                    </div><!--身份证号码-->
                                    <div class="layui-form-item">
                                        <label class="layui-form-label">上传法人身份证照片：</label>
                                        <?php if ($account_period_apply['verify_status'] == 2) { ?>
                                            <div class="layui-input-block">
                                                <div class="apply-payment-file-box">
                                                    <div class="layui-upload input-business-license bg-icon_addphoto_n">
                                                        <button type="button" class="layui-btn" id="test2">上传图片</button>
                                                        <div class="layui-upload-list">
                                                            <img class="layui-upload-img" id="demo2"
                                                                 src="<?php echo $company_info['id_card_front_pic_path'] ? $this->config->item("upload_url") . $company_info['id_card_front_pic_path'] : ''; ?>">
                                                            <!--<p id="demoText"></p>-->
                                                        </div>
                                                    </div>
                                                </div>
                                                <div class="apply-payment-file-box">
                                                    <div class="layui-upload input-business-license bg-icon_addphoto_n">
                                                        <button type="button" class="layui-btn" id="test3">上传图片</button>
                                                        <div class="layui-upload-list">
                                                            <img class="layui-upload-img" id="demo3"
                                                                 src="<?php echo $company_info['id_card_back_pic_path'] ? $this->config->item("upload_url") . $company_info['id_card_back_pic_path'] : ''; ?>">
                                                            <!--<p id="demoText"></p>-->
                                                        </div>
                                                    </div>
                                                </div>
                                                <p class="apply-payment-file-p">请上传原件彩色照片；图片尺寸最大不超过5M</p>
                                            </div>
                                        <?php } else { ?>
                                            <div class="layui-input-block">
                                                <div class="apply-payment-file-box">
                                                    <div class="layui-upload input-business-license bg-icon_addphoto_n">
                                                        <div class="layui-upload-list">
                                                            <img class="layui-upload-img"
                                                                 src="<?php echo $company_info['id_card_front_pic_path'] ? $this->config->item("upload_url") . $company_info['id_card_front_pic_path'] : ''; ?>">
                                                            <!--<p id="demoText"></p>-->
                                                        </div>
                                                    </div>
                                                </div>
                                                <div class="apply-payment-file-box">
                                                    <div class="layui-upload input-business-license bg-icon_addphoto_n">
                                                        <div class="layui-upload-list">
                                                            <img class="layui-upload-img"
                                                                 src="<?php echo $company_info['id_card_front_pic_path'] ? $this->config->item("upload_url") . $company_info['id_card_front_pic_path'] : ''; ?>">
                                                            <!--<p id="demoText"></p>-->
                                                        </div>
                                                    </div>
                                                </div>
                                                <p class="apply-payment-file-p">请上传原件彩色照片；图片尺寸最大不超过5M</p>
                                            </div>


                                        <?php } ?>
                                    </div><!--上传法人身份证照片-->
                                    <div class="layui-form-item">
                                        <label class="layui-form-label">注册邀请人手机号：</label>
                                        <div class="layui-input-block">
                                            <input type="tel"
                                                   name="inviter_tel" <?php if ($account_period_apply['verify_status'] == 0): ?> disabled <?php endif; ?>
                                                   id="inviter_tel" value="<?php echo $company_info['inviter_tel']; ?>"
                                                   maxlength="11" lay-verify="nullphone" placeholder="请输入邀请人手机号 "
                                                   autocomplete="off" class="layui-input">
                                        </div>
                                    </div><!--注册邀请人手机号-->
                                </div>

                            </div>
                        </div>  <!--审核资料-->

                        <div class="workbench-detail-box workbench-detail-box2 workbench-detail-box-jbzl">
                            <p class="workbench-detail-tit">
                                采购信息
                                <a href="javascript:;" class="icon workbench-detail-btn-up bg-btn_opentip ">查看更多</a>
                            </p>
                            <div class="workbench-detail-cont">
                                <div class="apply-payment-box">


                                    <div class="layui-form-item">
                                        <label class="layui-form-label">每月最低采购金额：</label>
                                        <div class="layui-input-block">
                                            <input type="text"
                                                   name="minimum_purchase_amount" <?php if ($account_period_apply['verify_status'] == 0): ?> disabled <?php endif; ?>
                                                   id="minimum_purchase_amount"
                                                   value="<?php echo $company_info['minimum_purchase_amount']; ?>"
                                                   required placeholder="请输入金额" lay-verify="number|positive"
                                                   autocomplete="off" class="layui-input">
                                            <span class="input-unit">元</span>
                                        </div>
                                    </div><!--每月最低采购金额-->
                                    <div class="layui-form-item">
                                        <label class="layui-form-label">收货地址：</label>
                                        <?php if ($account_period_apply['verify_status'] == 2) { ?>
                                            <div class="layui-input-block">
                                                <div class="city-box">
                                                    <div id="distpicker2">
                                                        <div class="form-group">
                                                            <div style="position: relative;">
                                                                <input id="city-picker2" class="form-control"
                                                                       rel="<?php echo $account_period_apply['verify_status']; ?>"
                                                                       readonly type="text" value="请选择省/市/区"
                                                                       data-toggle="city-picker">
                                                            </div>
                                                        </div>
                                                    </div>
                                                </div>
                                                <input type="text" name="shipping_address" id="shipping_address"
                                                       value="<?php echo $company_info['shipping_address']; ?>" required
                                                       placeholder="请输入详细地址" autocomplete="off" class="layui-input">
                                            </div>
                                        <?php } else { ?>
                                            <div class="layui-input-block">
                                                <?php if ($account_period_apply['verify_status'] == 0): ?>
                                                    <div class="city-box">
                                                        <input type="text" name="shipping_address"
                                                               value="<?php echo $company_info['shipping_province']; ?>/<?php echo $company_info['shipping_city']; ?>/<?php echo $company_info['shipping_district']; ?>"
                                                               disabled required placeholder="请输入详细地址"
                                                               autocomplete="off" class="layui-input">
                                                    </div>
                                                <?php else: ?>
                                                    <div class="city-box">
                                                        <div id="distpicker2">
                                                            <div class="form-group">
                                                                <div style="position: relative;">
                                                                    <input id="city-picker2" class="form-control"
                                                                           readonly type="text" value="请选择省/市/区"
                                                                           data-toggle="city-picker">
                                                                </div>
                                                            </div>
                                                        </div>
                                                    </div>
                                                <?php endif; ?>
                                                <input type="text" name="shipping_address" id="shipping_address"
                                                       value="<?php echo $company_info['shipping_address']; ?>" disabled
                                                       required placeholder="请输入详细地址" autocomplete="off"
                                                       class="layui-input">
                                            </div>
                                        <?php } ?>
                                    </div>
                                    <!--企业所在地-->
                                    <div class="layui-form-item">
                                        <label class="layui-form-label">收货人姓名：</label>
                                        <div class="layui-input-block">
                                            <input type="text"
                                                   name="shipping_name" <?php if ($account_period_apply['verify_status'] == 0): ?> disabled <?php endif; ?>
                                                   id="shipping_name"
                                                   value="<?php echo $company_info['shipping_name']; ?>" required
                                                   placeholder="请输入收货人姓名"
                                                   autocomplete="off" class="layui-input">
                                        </div>
                                    </div><!--收货人姓名-->
                                    <div class="layui-form-item">
                                        <label class="layui-form-label">联系电话：</label>
                                        <div class="layui-input-block">
                                            <input type="tel" name="shipping_tel"
                                                   id="shipping_tel" <?php if ($account_period_apply['verify_status'] == 0): ?> disabled <?php endif; ?>
                                                   value="<?php echo $company_info['shipping_tel']; ?>" maxlength="11"
                                                   required lay-verify="required|phone" placeholder="请输入手机号 "
                                                   autocomplete="off" class="layui-input">
                                        </div>
                                    </div>
                                    <!--联系电话-->
                                    <div class="layui-form-item">
                                        <label class="layui-form-label">第二收货人姓名：</label>
                                        <div class="layui-input-block">
                                            <input type="text"
                                                   name="shipping_name_second" <?php if ($account_period_apply['verify_status'] == 0): ?> disabled <?php endif; ?>
                                                   id="shipping_name_second"
                                                   value="<?php echo $company_info['shipping_name_second']; ?>"
                                                   placeholder="请输入收货人姓名"
                                                   autocomplete="off" class="layui-input">
                                        </div>
                                    </div>
                                    <!--第二收货人姓名-->
                                    <div class="layui-form-item">
                                        <label class="layui-form-label">第二收货人联系电话：</label>
                                        <div class="layui-input-block">
                                            <input type="tel" name="shipping_tel_second"
                                                   id="shipping_tel_second" <?php if ($account_period_apply['verify_status'] == 0): ?> disabled <?php endif; ?>
                                                   value="<?php echo $company_info['shipping_tel_second']; ?>"
                                                   maxlength="11" lay-verify="nullphone" placeholder="请输入手机号 "
                                                   autocomplete="off" class="layui-input">
                                        </div>
                                    </div>
                                    <!--第二收货人联系电话-->

                                </div>

                            </div>
                        </div>  <!--采购信息-->

                        <div class="workbench-detail-box workbench-detail-box2 workbench-detail-box-jbzl">
                            <p class="workbench-detail-tit">
                                发票抬头
                                <a href="javascript:;" class="icon workbench-detail-btn-up bg-btn_opentip">查看更多</a>
                            </p>
                            <div class="workbench-detail-cont">
                                <div class="apply-payment-box">


                                    <div class="layui-form-item">
                                        <div class="layui-input-block apply-payment-radio-wrapper">
                                            <div class="apply-payment-radio-row">
                                                <input type="radio" name="mark_invoice_type" value="1"
                                                       title="逐月开票" <?php if ($company_info['mark_invoice_type'] == 1): ?> checked <?php endif; ?> >
                                            </div>
                                            <p class="apply-payment-radio-text">
                                                即乙方在每月固定日将双方于上一个对账周期发生的交易账单明细及与账单总额相应的发票送达给甲方。</p>
                                            <div class="apply-payment-radio-row">
                                                <input type="radio" name="mark_invoice_type" value="2"
                                                       title="逐次开票" <?php if ($company_info['mark_invoice_type'] == 2): ?> checked <?php endif; ?> >
                                            </div>
                                            <p class="apply-payment-radio-text">
                                                即乙方每次送货至甲方时，同时送达该次送货所对应的货物发票，若发生退换货，则相应地调整发票内容。</p>
                                        </div>
                                    </div><!--单位名称-->
                                    <div class="layui-form-item">
                                        <div class="layui-input-block apply-payment-radio-wrapper mb35">
                                            <input type="radio" name="invoice_type" id="zzs_id" value="1"
                                                   title="增值税专用发票" <?php if ($company_info['invoice_type'] == 1): ?> checked <?php endif; ?> >
                                            <input type="radio" name="invoice_type" id="zzspt_id" value="2"
                                                   title="增值税普通发票" <?php if ($company_info['invoice_type'] == 2): ?> checked <?php endif; ?> >
                                            <input type="radio" name="invoice_type" id="wfp_id" value="3"
                                                   title="无需发票" <?php if ($company_info['invoice_type'] == 3): ?> checked <?php endif; ?> >
                                        </div>
                                    </div><!--单位名称-->
                                    <div class="layui-form-item" id="dwmc_div">
                                        <label class="layui-form-label">单位名称：</label>
                                        <input type="text"
                                               name="invoice_company_name" <?php if ($account_period_apply['verify_status'] == 0): ?> disabled <?php endif; ?>
                                               id="invoice_company_name"
                                               value="<?php echo $company_info['invoice_company_name'] ? $company_info['invoice_company_name'] : $company_info['invoice_normal_company_name']; ?>"
                                               required
                                               placeholder="请输入单位名称"
                                               autocomplete="off" class=" layui-input">
                                    </div>

                                    <div class="layui-form-item" id="nsrsbm_div">
                                        <label class="layui-form-label">纳税人识别码：</label>
                                        <div class="layui-input-block">
                                            <input type="text"
                                                   name="invoice_code" <?php if ($account_period_apply['verify_status'] == 0): ?> disabled <?php endif; ?>
                                                   id="invoice_code"
                                                   value="<?php echo $company_info['invoice_code'] ? $company_info['invoice_code'] : $company_info['invoice_normal_code']; ?>"
                                                   required
                                                   placeholder="请输入纳税人识别码"
                                                   autocomplete="off" class=" layui-input">
                                        </div>
                                    </div><!--纳税人识别码-->
                                    <div class="layui-form-item" id="zcdz_div">
                                        <label class="layui-form-label">注册地址：</label>
                                        <div class="layui-input-block">
                                            <input type="text"
                                                   name="invoice_address" <?php if ($account_period_apply['verify_status'] == 0): ?> disabled <?php endif; ?>
                                                   id="invoice_address"
                                                   value="<?php echo $company_info['invoice_address']; ?>" required
                                                   placeholder="请输入开票地址"
                                                   autocomplete="off" class=" layui-input">
                                        </div>
                                    </div><!--注册地址-->
                                    <div class="layui-form-item" id="zcdh_div">
                                        <label class="layui-form-label">注册电话：</label>
                                        <div class="layui-input-block">
                                            <input type="text"
                                                   name="invoice_tel" <?php if ($account_period_apply['verify_status'] == 0): ?> disabled <?php endif; ?>
                                                   id="invoice_tel" value="<?php echo $company_info['invoice_tel']; ?>"
                                                   required
                                                   placeholder="请输入开票电话"
                                                   autocomplete="off" class=" layui-input">
                                        </div>
                                    </div><!--注册电话*-->
                                    <div class="layui-form-item" id="khyh_div">
                                        <label class="layui-form-label">开户银行：</label>
                                        <div class="layui-input-block">
                                            <input type="text"
                                                   name="invoice_bank" <?php if ($account_period_apply['verify_status'] == 0): ?> disabled <?php endif; ?>
                                                   id="invoice_bank"
                                                   value="<?php echo $company_info['invoice_bank']; ?>" required
                                                   placeholder="请输入银行名称"
                                                   autocomplete="off" class=" layui-input">
                                        </div>
                                    </div><!--开户银行-->
                                    <div class="layui-form-item" id="yhzh_div">
                                        <label class="layui-form-label">银行账户：</label>
                                        <div class="layui-input-block">
                                            <input type="text"
                                                   name="invoice_account" <?php if ($account_period_apply['verify_status'] == 0): ?> disabled <?php endif; ?>
                                                   id="invoice_account"
                                                   value="<?php echo $company_info['invoice_account']; ?>" required
                                                   placeholder="请输入银行账户"
                                                   autocomplete="off" class=" layui-input">
                                        </div>
                                    </div><!--银行账户-->


                                </div>
                            </div>

                        </div>    <!--发票抬头-->

                        <div style="display: none">
                            <input type="hidden" name="business_license_pic_path" id="business_license_pic_path"
                                   value="<?php echo $company_info['business_license_pic_path'] ?>">
                            <input type="hidden" name="id_card_front_pic_path" id="id_card_front_pic_path"
                                   value="<?php echo $company_info['id_card_front_pic_path'] ?>">
                            <input type="hidden" name="id_card_back_pic_path" id="id_card_back_pic_path"
                                   value="<?php echo $company_info['id_card_back_pic_path'] ?>">

                            <input type="hidden" name="province" id="province"
                                   value="<?php echo $company_info['province'] ?>">
                            <input type="hidden" name="city" id="city" value="<?php echo $company_info['city'] ?>">
                            <input type="hidden" name="district" id="district"
                                   value="<?php echo $company_info['district'] ?>">

                            <input type="hidden" name="shipping_province" id="shipping_province"
                                   value="<?php echo $company_info['shipping_province'] ?>">
                            <input type="hidden" name="shipping_city" id="shipping_city"
                                   value="<?php echo $company_info['shipping_city'] ?>">
                            <input type="hidden" name="shipping_district" id="shipping_district"
                                   value="<?php echo $company_info['shipping_district'] ?>">
                        </div>

                        <?php if ($account_period_apply['verify_status'] == 2) { ?>
                            <button class="layui-btn btn-next" onclick="change_param()" id="submit-form" lay-submit
                                    lay-filter="*">提 交
                            </button>

                        <?php } ?>

                    </form>
                </div>
            </div>

            <div class="apply-payment-form-wrapper">
                <form class="layui-form apply-payment-form" action="">
                    <div class="apply-payment-box apply-payment-box-cg none"></div>   <!--采购信息-->
                    <div class="apply-payment-box apply-payment-box-zpzz none"></div> <!--增票资质-->
                </form>
            </div>
        </div>

    </div>

    <?php $this->load->view('common/bottom.php'); ?>
</div>
<script type="text/javascript" src="public/js/jquery.min.js"></script>
<script src="public/js/layui/layui.js"></script>
<script src="public/js/city-picker.data.js"></script>
<script src="public/js/city-picker.js"></script>
<script type="text/javascript" src="public/js/index.js"></script>
<script>
    layui.use(['form', 'layedit', 'laydate', 'upload'], function () {
        var form = layui.form
            , layer = layui.layer
            , layedit = layui.layedit;
        var $ = layui.jquery
            , upload = layui.upload;

        form.verify({
            nullphone: function (value, item) { //value：表单的值、item：表单的DOM对象
                if (!value) {
                } else {
                    if (!(/^[1][3,4,5,7,8][0-9]{9}$/.test(value))) {
                        return '请输入正确的手机号';
                    }
                }
            },
            positive: function (value, item) {
                if (value < 0) {
                    return '必选大于0';
                }
            }


        });

        //普通图片上传
        var uploadInst = upload.render({
            elem: '#test1'
            , url: 'upload/upload_image'
            , before: function (obj) {
                //预读本地文件示例，不支持ie8
                obj.preview(function (index, file, result) {
                    $('#demo1').attr('src', result); //图片链接（base64）
                });
            }
            , done: function (res) {
                //如果上传失败
                if (res.code < 0) {
                    $("#business_license_pic_path").val('');
                    $('#demo1').attr('src', '')
                    return layer.msg('上传失败');
                } else {
                    $("#business_license_pic_path").val(res.data.file_name);
                    $('#demo1').attr('src', "<?php echo $this->config->item('upload_url');?>" + res.data.file_name);
                    return layer.msg('上传成功');
                }
                //上传成功
            }
            , error: function () {
                //演示失败状态，并实现重传
                var demoText = $('#demoText');
                demoText.html('<span style="color: #FF5722;">上传失败</span> <a class="layui-btn layui-btn-mini demo-reload">重试</a>');
                demoText.find('.demo-reload').on('click', function () {
                    uploadInst.upload();
                });
            }
        });
        var uploadInst2 = upload.render({
            elem: '#test2'
            , url: 'upload/upload_image'
            , before: function (obj) {
                //预读本地文件示例，不支持ie8
                obj.preview(function (index, file, result) {
                    $('#demo2').attr('src', result); //图片链接（base64）
                });
            }
            , done: function (res) {
                //如果上传失败
                if (res.code < 0) {
                    $("#id_card_front_pic_path").val('');
                    $('#demo2').attr('src', '')
                    return layer.msg('上传失败');
                } else {
                    $("#id_card_front_pic_path").val(res.data.file_name);
                    $('#demo2').attr('src', "<?php echo $this->config->item('upload_url');?>" + res.data.file_name);
                    return layer.msg('上传成功');
                }
            }
            , error: function () {
                //演示失败状态，并实现重传
                var demoText = $('#demoText');
                demoText.html('<span style="color: #FF5722;">上传失败</span> <a class="layui-btn layui-btn-mini demo-reload">重试</a>');
                demoText.find('.demo-reload').on('click', function () {
                    uploadInst.upload();
                });
            }
        });
        var uploadInst3 = upload.render({
            elem: '#test3'
            , url: 'upload/upload_image'
            , before: function (obj) {
                //预读本地文件示例，不支持ie8
                obj.preview(function (index, file, result) {
                    $('#demo3').attr('src', result); //图片链接（base64）
                });
            }
            , done: function (res) {
                //如果上传失败
                if (res.code < 0) {
                    $("#id_card_back_pic_path").val('');
                    $('#demo3').attr('src', '')
                    return layer.msg('上传失败');
                } else {
                    $("#id_card_back_pic_path").val(res.data.file_name);
                    $('#demo3').attr('src', "<?php echo $this->config->item('upload_url');?>" + res.data.file_name);
                    return layer.msg('上传成功');
                }
            }
            , error: function () {
                //演示失败状态，并实现重传
                var demoText = $('#demoText');
                demoText.html('<span style="color: #FF5722;">上传失败</span> <a class="layui-btn layui-btn-mini demo-reload">重试</a>');
                demoText.find('.demo-reload').on('click', function () {
                    uploadInst.upload();
                });
            }
        });

        //监听提交
        form.on('submit(*)', function (data) {

            console.log(data.elem) //被执行事件的元素DOM对象，一般为button对象
            console.log(data.form) //被执行提交的form对象，一般在存在form标签时才会返回
            console.log(data.field) //当前容器的全部表单字段，名值对形式：{name: value}
            $.ajax({
                type: "post",
                dataType: "json",
                url: "customer/admin_apply_for_period_user",
                data: data.field,
                jsonp: 'callback',
                async: false,
                success: function (data) {
                    if (data.code == 0) {
                        layer.alert("保存成功");
                        window.location.href = "index";
                    } else {
                        if (data.msg == '验证码错误') {
                            var a = $('#code').offset().top;
                            $("html,body").animate({scrollTop: a}, 'slow');
                        }
                        layer.msg(data.msg)
                    }
                }
            });
            return false; //阻止表单跳转。如果需要表单跳转，去掉这段即可。
        });

        // $('#shtyxydm').next().click(function () {
        //     $("#change_yyzz_id").attr('placeholder', '请输入统一社会信用代码');
        //     $("#change_yyzz_id").attr('name', 'credit_code');
        // });
        //
        // $('#yyzzzch').next().click(function () {
        //     $("#change_yyzz_id").attr('placeholder', '请输入营业执照注册号');
        //     $("#change_yyzz_id").attr('name', 'business_license_number');
        // });
        $('#zzs_id').next().click(function () {
            $("#dwmc_div").show();
            $("#nsrsbm_div").show();
            $("#zcdz_div").show();
            $("#zcdh_div").show();
            $("#khyh_div").show();
            $("#yhzh_div").show();
        });

        $('#zzspt_id').next().click(function () {
            $("#dwmc_div").show();
            $("#nsrsbm_div").show();
            $("#zcdz_div").hide();
            $("#zcdh_div").hide();
            $("#khyh_div").hide();
            $("#yhzh_div").hide();
        });

        $('#wfp_id').next().click(function () {
            $("#dwmc_div").hide();
            $("#nsrsbm_div").hide();
            $("#zcdz_div").hide();
            $("#zcdh_div").hide();
            $("#khyh_div").hide();
            $("#yhzh_div").hide();
        });


    });
</script>
<?php if ($company_info['invoice_type'] == 1): ?>
    <script type="text/javascript">

    </script>
<?php elseif ($company_info['invoice_type'] == 2): ?>
    <script type="text/javascript">
        $(function () {
            $("#dwmc_div").show();
            $("#nsrsbm_div").show();
            $("#zcdz_div").hide();
            $("#zcdh_div").hide();
            $("#khyh_div").hide();
            $("#yhzh_div").hide();
        });
    </script>
<?php elseif ($company_info['invoice_type'] == 3): ?>
    <script type="text/javascript">
        $(function () {
            $("#dwmc_div").hide();
            $("#nsrsbm_div").hide();
            $("#zcdz_div").hide();
            $("#zcdh_div").hide();
            $("#khyh_div").hide();
            $("#yhzh_div").hide();
        });
    </script>
<?php endif; ?>

<script type="text/javascript">
    $(function () {
        $("#city-picker1").citypicker();
        $("#city-picker1").citypicker("reset");
        $("#city-picker1").citypicker("destroy");
        $("#city-picker1").citypicker({
            province: "<?php echo $company_info['province']; ?>",
            city: "<?php echo $company_info['city']; ?>",
            district: "<?php echo $company_info['district']; ?>"
        });

        $(".workbench-detail-btn-up").click(function () {
            $(this).parent().next().toggle();
            $(this).toggleClass('bg-btn_Shuttip');
        });

        $("#city-picker2").citypicker();
        $("#city-picker2").citypicker("reset");
        $("#city-picker2").citypicker("destroy");
        $("#city-picker2").citypicker({
            province: "<?php echo $company_info['shipping_province']; ?>",
            city: "<?php echo $company_info['shipping_city']; ?>",
            district: "<?php echo $company_info['shipping_district']; ?>"
        });

        $(".btn-next-step").click(function () {
            var index = $(this).attr('data-index');
            $('.step-box-item' + index).addClass('step-box-item-click step-box-item_h');
            $('.apply-payment-box ').eq(index).show().siblings().hide();
        });

        $(".step-box-container").delegate(".step-box-item-click", "click", function () {
            var index = $(this).attr('data-index');
            $('.apply-payment-box ').eq(index).show().siblings().hide();
        });
    });
</script>

<script>
    var clock = '';
    var nums = 60;
    var btn;

    function sendCode(thisBtn) {
        var tel = $("#tel").val();
        if (!tel) {
            layer.alert('请先填写联系人手机号');
        } else {
            $.ajax({
                type: "POST",
                url: "customer/send_check_code",
                data: {tel: tel},
                dataType: "json",
                success: function (data) {
                    if (data.code == 0) {
                        btn = thisBtn;
                        btn.disabled = true; //将按钮置为不可点击
                        btn.value = nums + '秒后可重新获取';
                        clock = setInterval(doLoop, 1000); //一秒执行一次
                        return layer.alert('发送成功');
                    } else {
                        layer.alert('发送失败');
                    }
                }
            });
        }
    }

    function doLoop() {
        nums--;
        if (nums > 0) {
            btn.value = nums + '秒后可重新获取';
        } else {
            clearInterval(clock); //清除js定时器
            btn.disabled = false;
            btn.value = '点击发送验证码';
            nums = 10; //重置时间
        }
    }

    $("#submit-form").click(function (e) {
        if (!$('#name').val()) {
            var a = $('.layui-form-item').offset().top;
            $("html,body").animate({scrollTop: a}, 'slow');
            layer.msg('企业名称必须填写');
            e.stopPropagation();
            return false;
        } else {
            // var reg=/^[A-Za-z0-9\_\-\(\)（）\u4e00-\u9fa5]+$/;//中文，英文和数字
            var name = $('#name').val();
            if (!/^[A-Za-z0-9\_\-\(\)（）\u4e00-\u9fa5]+$/.test(name)) {
                var a = $('#name').offset().top;
                $("html,body").animate({scrollTop: a}, 'slow');
                layer.msg('企业名称请输入中英文，数字,"-","_","（）","()"的组合');
                e.stopPropagation();
                return false;
            }
            if ($.trim(name).length < 4 || $.trim(name).length > 40) {
                var a = $('.layui-form-item').offset().top;
                $("html,body").animate({scrollTop: a}, 'slow');
                layer.msg('企业名称请输入4-40个字符');
                e.stopPropagation();
                return false;
            }
        }

        if (!$('#city-picker1').val()) {
            var a = $('#distpicker1 .city-picker-span').offset().top;
            $("html,body").animate({scrollTop: a}, 'slow');
            layer.msg('企业所在地必须选择');
            e.stopPropagation();
            return false;
        }

        if (!$('#address').val()) {
            var a = $('#distpicker1 .city-picker-span').offset().top;
            $("html,body").animate({scrollTop: a}, 'slow');
            layer.msg('企业详细地址必须填写');
            e.stopPropagation();
            return false;
        } else {
            // var reg=/^(?=.*?[\u4E00-\u9FA5])/;
            var address = $('#address').val();
            if (!/^(?=.*?[\u4E00-\u9FA5])/.test(address)) {
                var a = $('#distpicker1 .city-picker-span').offset().top;
                $("html,body").animate({scrollTop: a}, 'slow');
                layer.msg('企业详细地址不能全为数字或字母');
                e.stopPropagation();
                return false;
            }
            if ($.trim(address).length < 6 || $.trim(address).length > 60) {
                var a = $('#distpicker1 .city-picker-span').offset().top;
                $("html,body").animate({scrollTop: a}, 'slow');
                layer.msg('企业详细地址必须为6-60个字符');
                e.stopPropagation();
                return false;
            }
        }

        if (!$('#demo1').attr('src')) {
            var a = $('#demo1').offset().top;
            $("html,body").animate({scrollTop: a}, 'slow');
            layer.msg('营业执照必须上传');
            e.stopPropagation();
            return false;
        }

        var change_cc = $('#change_cc').val();
        var change_bln = $('#change_bln').val();
        if (!change_bln && !change_cc) {
            var a = $('#zch-div').offset().top;
            $("html,body").animate({scrollTop: a}, 'slow');
            layer.msg('统一社会信用代码或营业执照注册号必须填写');
            e.stopPropagation();
            return false;
        } else {
            if (change_cc) {
                if (!/^[A-Za-z0-9]+$/.test(change_cc)) {
                    var a = $('#zch-div').offset().top;
                    $("html,body").animate({scrollTop: a}, 'slow');
                    layer.msg('统一社会信用代码只能输入数字或字母');
                    e.stopPropagation();
                    return false;
                }
                var change_cclength = change_cc.length;
                if (change_cclength !== 18) {
                    var a = $('#zch-div').offset().top;
                    $("html,body").animate({scrollTop: a}, 'slow');
                    layer.msg('社会信用代码格式输入错误，请核对！');
                    e.stopPropagation();
                    return false;
                }
            }
            if (change_bln) {
                if (!/^[A-Za-z0-9]+$/.test(change_bln)) {
                    var a = $('#zch-div').offset().top;
                    $("html,body").animate({scrollTop: a}, 'slow');
                    layer.msg('营业执照注册号只能输入数字或字母');
                    e.stopPropagation();
                    return false;
                }
                var change_blnlength = change_bln.length;
                if (change_blnlength !== 15 && change_blnlength !== 18) {
                    var a = $('#zch-div').offset().top;
                    $("html,body").animate({scrollTop: a}, 'slow');
                    layer.msg('营业执照注册号格式输入错误，请核对！');
                    e.stopPropagation();
                    return false;
                }
            }

        }
        if (!$('#phone').val()) {
            var a = $('#phone').offset().top;
            $("html,body").animate({scrollTop: a}, 'slow');
            layer.msg('办公电话必须填写');
            e.stopPropagation();
            return false;
        } else {
            var tel = $('#phone').val();
            var phone = tel.length;
            if (!/^0\d{2,3}-?\d{7,8}(-\d{1,8})?$/.test(tel)) {
                if (!/^1[345789]{1}\d{9}$/.test(tel)) {
                    var a = $('#phone').offset().top;
                    $("html,body").animate({scrollTop: a}, 'slow');
                    layer.msg('办公电话格式输入错误，请核对');
                    return false;
                }
            }
            // if (phone < 11 || phone > 20) {
            //     var a = $('#phone').offset().top;
            //     $("html,body").animate({scrollTop: a}, 'slow');
            //     layer.msg('请输入11-20位而字符');
            //     return false;
            // }
        }

        if (!$('#contractor').val()) {
            var a = $('#contractor').offset().top;
            $("html,body").animate({scrollTop: a}, 'slow');
            layer.msg('合同签订人姓名必须填写');
            e.stopPropagation();
            return false;
        } else {
            // var reg=/^[\u4e00-\u9fa5]+$/;
            var contractor = $('#contractor').val();
            if (!/^[\u4e00-\u9fa5]+$/.test(contractor)) {
                var a = $('#contractor').offset().top;
                $("html,body").animate({scrollTop: a}, 'slow');
                layer.msg('合同签订人姓名请输入中文');
                e.stopPropagation();
                return false;
            }
            if ($.trim(contractor).length < 2 || $.trim(contractor).length > 20) {
                var a = $('#contractor').offset().top;
                $("html,body").animate({scrollTop: a}, 'slow');
                layer.msg('必须为2-20个字符');
                e.stopPropagation();
                return false;
            }
        }

        if (!$('#email').val()) {
            var a = $('#email').offset().top;
            $("html,body").animate({scrollTop: a}, 'slow');
            layer.msg('合同签订人邮箱必须填写');
            e.stopPropagation();
            return false;
        } else {
            var reg = new RegExp("^[a-z0-9]+([._\\-]*[a-z0-9])*@([a-z0-9]+[-a-z0-9]*[a-z0-9]+.){1,63}[a-z0-9]+$");
            var email = $('#email').val();
            if (!reg.test(email)) {
                var a = $('#email').offset().top;
                $("html,body").animate({scrollTop: a}, 'slow');
                layer.msg('E-mail地址不规范，请重新填写');
                return false;
            }
        }

        if (!$('#tel').val()) {
            var a = $('#tel').offset().top;
            $("html,body").animate({scrollTop: a}, 'slow');
            layer.msg('联系人手机必须填写');
            e.stopPropagation();
            return false;
        } else {
            // var phone_reg =/^[1][3,4,5,7,8][0-9]{9}$/ ;
            var new_tel = $('#tel').val();
            if (!/^1[345789]{1}\d{9}$/.test(new_tel)) {
                var a = $('#tel').offset().top;
                $("html,body").animate({scrollTop: a}, 'slow');
                layer.msg('手机号不规范，请重填');
                return false;
            }
        }

        if (!$('#code').val()) {
            var a = $('#code').offset().top;
            $("html,body").animate({scrollTop: a}, 'slow');
            layer.msg('请输入验证码');
            e.stopPropagation();
            return false;
        } else {
            var code = $('#code').val();
            var codelength = $.trim(code).length;
            if (codelength !== 6) {
                var a = $('#code').offset().top;
                $("html,body").animate({scrollTop: a}, 'slow');
                layer.msg('请输入6位验证码');
                e.stopPropagation();
                return false;
            }
        }

        if (!$('#id_card_no').val()) {
            var a = $('#id_card_no').offset().top;
            $("html,body").animate({scrollTop: a}, 'slow');
            layer.msg('请输入二代身份证号码');
            e.stopPropagation();
            return false;
        } else {
            // var reg = /(^\d{15}$)|(^\d{17}([0-9]|X|x)$)/;
            // var reg = /^(\d{15}$)|(^\d{17}([0-9]|X))$/isu;
            var card = $('#id_card_no').val();
            if (!/(^\d{15}$)|(^\d{17}([0-9]|X|x)$)/.test(card)) {
                var a = $('#id_card_no').offset().top;
                $("html,body").animate({scrollTop: a}, 'slow');
                layer.msg('无效的身份证号');
                e.stopPropagation();
                return false;
            }

            function IdentityCodeValid(code) {
                var city = {
                    11: "北京",
                    12: "天津",
                    13: "河北",
                    14: "山西",
                    15: "内蒙古",
                    21: "辽宁",
                    22: "吉林",
                    23: "黑龙江 ",
                    31: "上海",
                    32: "江苏",
                    33: "浙江",
                    34: "安徽",
                    35: "福建",
                    36: "江西",
                    37: "山东",
                    41: "河南",
                    42: "湖北 ",
                    43: "湖南",
                    44: "广东",
                    45: "广西",
                    46: "海南",
                    50: "重庆",
                    51: "四川",
                    52: "贵州",
                    53: "云南",
                    54: "西藏 ",
                    61: "陕西",
                    62: "甘肃",
                    63: "青海",
                    64: "宁夏",
                    65: "新疆",
                    71: "台湾",
                    81: "香港",
                    82: "澳门",
                    91: "国外 "
                };
                var tip = "";
                var pass = true;
                if (!code || !/^\d{6}(18|19|20)?\d{2}(0[1-9]|1[12])(0[1-9]|[12]\d|3[01])\d{3}(\d|X)$/i.test(code)) {
                    tip = "身份证号格式错误";
                    pass = false;
                }

                else if (!city[code.substr(0, 2)]) {
                    tip = "地址编码错误";
                    pass = false;
                }
                else {
                    //18位身份证需要验证最后一位校验位
                    if (code.length == 18) {
                        code = code.split('');
                        //∑(ai×Wi)(mod 11)
                        //加权因子
                        var factor = [7, 9, 10, 5, 8, 4, 2, 1, 6, 3, 7, 9, 10, 5, 8, 4, 2];
                        //校验位
                        var parity = [1, 0, 'X', 9, 8, 7, 6, 5, 4, 3, 2];
                        var sum = 0;
                        var ai = 0;
                        var wi = 0;
                        for (var i = 0; i < 17; i++) {
                            ai = code[i];
                            wi = factor[i];
                            sum += ai * wi;
                        }
                        var last = parity[sum % 11];
                        if (parity[sum % 11] != code[17]) {
                            tip = "校验位错误";
                            pass = false;
                        }
                    }
                }
                return pass;
            }

            if (!IdentityCodeValid(card)) {
                var a = $('#id_card_no').offset().top;
                $("html,body").animate({scrollTop: a}, 'slow');
                layer.msg('无效的身份证号');
                e.stopPropagation();
                return false;
            }

        }

        if (!$('#demo2').attr('src')) {
            var a = $('#demo2').offset().top;
            $("html,body").animate({scrollTop: a}, 'slow');
            layer.msg('法人身份证照片必须上传');
            e.stopPropagation();
            return false;
        }

        if (!$('#demo3').attr('src')) {
            var a = $('#demo3').offset().top;
            $("html,body").animate({scrollTop: a}, 'slow');
            layer.msg('法人身份证照片必须上传');
            e.stopPropagation();
            return false;
        }

        if ($('#inviter_tel').val()) {
            // var phone_reg = /^[1][3,4,5,7,8][0-9]{9}$/;
            var new_tel = $('#inviter_tel').val();
            if (!/^1[345789]{1}\d{9}$/.test(new_tel)) {
                var a = $('#inviter_tel').offset().top;
                $("html,body").animate({scrollTop: a}, 'slow');
                layer.msg('手机号不规范，请重填');
                return false;
            }
        }

        if (!$('#minimum_purchase_amount').val()) {
            var a = $('#minimum_purchase_amount').offset().top;
            $("html,body").animate({scrollTop: a}, 'slow');
            layer.msg('请输入最低采购金额');
            e.stopPropagation();
            return false;
        } else {
            var tmptxt = $('#minimum_purchase_amount').val();
            // var reg = /^[1-9][0-9]*$/;
            if (!/^[1-9]\d*(\.\d+)?$/.test(tmptxt)) {
                var a = $('#minimum_purchase_amount').offset().top;
                $("html,body").animate({scrollTop: a}, 'slow');
                layer.msg('采购金额必须大于零');
                e.stopPropagation();
                return false;
            }
        }

        if (!$('#city-picker2').val()) {
            var a = $('#distpicker2 .city-picker-span').offset().top;
            $("html,body").animate({scrollTop: a}, 'slow');
            layer.msg('收货地址必须选择');
            e.stopPropagation();
            return false;
        }

        if (!$('#shipping_address').val()) {
            var a = $('#shipping_address').offset().top;
            $("html,body").animate({scrollTop: a}, 'slow');
            layer.msg('收货详细地址必须填写');
            e.stopPropagation();
            return false;
        } else {
            // var reg = '/^(?=.*?[\u4E00-\u9FA5])/';
            var shipping_address = $('#shipping_address').val();
            if (!/^(?=.*?[\u4E00-\u9FA5])/.test(shipping_address)) {
                var a = $('#distpicker2 .city-picker-span').offset().top;
                $("html,body").animate({scrollTop: a}, 'slow');
                layer.msg('收货地不能全为数字和字母');
                e.stopPropagation();
                return false;
            }
            if ($.trim(shipping_address).length < 6 || $.trim(shipping_address).length > 60) {
                var a = $('#distpicker2 .city-picker-span').offset().top;
                $("html,body").animate({scrollTop: a}, 'slow');
                layer.msg('收货地必须为6-60个字符');
                e.stopPropagation();
                return false;
            }
        }

        if (!$('#shipping_name').val()) {
            var a = $('#shipping_name').offset().top;
            $("html,body").animate({scrollTop: a}, 'slow');
            layer.msg('请输入收货人姓名');
            e.stopPropagation();
            return false;
        } else {
            // var reg = '/^[\u4e00-\u9fa5]+$/';
            var shipping_name = $('#shipping_name').val();
            if (!/^[\u4e00-\u9fa5]+$/.test(shipping_name)) {
                var a = $('#shipping_name').offset().top;
                $("html,body").animate({scrollTop: a}, 'slow');
                layer.msg('收货人姓名，请输入中文');
                e.stopPropagation();
                return false;
            }
            if ($.trim(shipping_name).length < 2 || $.trim(shipping_name).length > 20) {
                var a = $('#shipping_name').offset().top;
                $("html,body").animate({scrollTop: a}, 'slow');
                layer.msg('收货人姓名必须为2-20个字符');
                e.stopPropagation();
                return false;
            }
        }


        if (!$('#shipping_tel').val()) {
            var a = $('#shipping_tel').offset().top;
            $("html,body").animate({scrollTop: a}, 'slow');
            layer.msg('请输入联系电话');
            e.stopPropagation();
            return false;
        } else {
            var shooping_tel = $('#shipping_tel').val();
            // var mobile = /^[1][3,4,5,7,8][0-9]{9}$/;
            // var phone = /^0\d{2,3}-?\d{7,8}$/;
            //&& !phone.test(shooping_tel)
            if (!/^1[345789]{1}\d{9}$/.test(shooping_tel)) {
                var a = $('#shipping_tel').offset().top;
                $("html,body").animate({scrollTop: a}, 'slow');
                layer.msg('收货人联系电话有误，请重填');
                e.stopPropagation();
                return false;
            }
        }

        if ($('#shipping_name_second').val()) {
            // var reg=/^[\u4e00-\u9fa5]+$/;
            var shipping_name = $('#shipping_name_second').val();
            if (!/^[\u4e00-\u9fa5]+$/.test(shipping_name)) {
                var a = $('#shipping_name_second').offset().top;
                $("html,body").animate({scrollTop: a}, 'slow');
                layer.msg('第二收货人姓名，请输入中文');
                e.stopPropagation();
                return false;
            }
            if ($.trim(shipping_name).length < 2 || $.trim(shipping_name).length > 20) {
                var a = $('#shipping_name_second').offset().top;
                $("html,body").animate({scrollTop: a}, 'slow');
                layer.msg('第二收货人姓名必须为2-20个字符');
                e.stopPropagation();
                return false;
            }
        }

        if ($('#shipping_tel_second').val()) {
            var shooping_tel = $('#shipping_tel_second').val();
            // var mobile = /^[1][3,4,5,7,8][0-9]{9}$/;
            // var phone = /^0\d{2,3}-?\d{7,8}$/;
            //&& !phone.test(shooping_tel)
            if (!/^1[345789]{1}\d{9}$/.test(shooping_tel)) {
                var a = $('#shipping_tel_second').offset().top;
                $("html,body").animate({scrollTop: a}, 'slow');
                layer.msg('第二收货人联系电话有误，请重填');
                e.stopPropagation();
                return false;
            }
        }


        // if (typeof($("#distpicker1 [data-count='district']").attr('data-code')) == 'undefined') {
        //     layer.msg('企业所在地必须选择');
        //     e.stopPropagation();
        //     return false;
        // }
        // if (typeof($("#distpicker2 [data-count='district']").attr('data-code')) == 'undefined') {
        //     layer.msg('收货地必须选择');
        //     e.stopPropagation();
        // }
        $("#province").val($("#distpicker1 [data-count='province']").html())
        $("#city").val($("#distpicker1 [data-count='city']").html())
        $("#district").val($("#distpicker1 [data-count='district']").html())
        $("#shipping_province").val($("#distpicker2 [data-count='province']").html());
        $("#shipping_city").val($("#distpicker2 [data-count='city']").html());
        $("#shipping_district").val($("#distpicker2 [data-count='district']").html());

        if ($('#zzs_id').is(':checked')) {
            if (!$('#invoice_company_name').val()) {
                var a = $('#invoice_company_name').offset().top;
                $("html,body").animate({scrollTop: a}, 'slow');
                layer.msg('请输入单位名称');
                e.stopPropagation();
                return false;
            } else {
                // var reg = '/^[A-Za-z0-9\_\-\()\（）\u4e00-\u9fa5]+$/';//中文，英文和数字
                var name = $('#invoice_company_name').val();
                var company_name = $.trim(name).length;
                if (!/^[A-Za-z0-9_\-\(\)（）\u4e00-\u9fa5]+$/.test(name)) {
                    var a = $('#invoice_company_name').offset().top;
                    $("html,body").animate({scrollTop: a}, 'slow');
                    layer.msg('请输入中英文，数字,"-","_","（）","()"的组合');
                    e.stopPropagation();
                    return false;
                }
                if (company_name < 3 || company_name > 60) {
                    var a = $('#invoice_company_name').offset().top;
                    $("html,body").animate({scrollTop: a}, 'slow');
                    layer.msg('请输入3-60个字符');
                    e.stopPropagation();
                    return false;
                }
            }

            if (!$('#invoice_code').val()) {
                var a = $('#invoice_code').offset().top;
                $("html,body").animate({scrollTop: a}, 'slow');
                layer.msg('请输入纳税人识别码');
                e.stopPropagation();
                return false;
            } else {
                // var reg = '/^[a-zA-Z0-9]+$/';  //数字和字母
                var invoice_code = $('#invoice_code').val();
                if (!/^[a-zA-Z0-9]+$/.test(invoice_code)) {
                    var a = $('#invoice_code').offset().top;
                    $("html,body").animate({scrollTop: a}, 'slow');
                    layer.msg('识别码格式输入错误，请核对！');
                    e.stopPropagation();
                    return false;
                }
                var code = $.trim(invoice_code).length;
                // console.log(code);
                if (code !== 15 && code !== 18 && code !== 20) {
                    var a = $('#invoice_code').offset().top;
                    $("html,body").animate({scrollTop: a}, 'slow');
                    layer.msg('识别码格式输入错误，请核对！');
                    e.stopPropagation();
                    return false;
                }
            }

            if (!$('#invoice_address').val()) {
                var a = $('#invoice_address').offset().top;
                $("html,body").animate({scrollTop: a}, 'slow');
                layer.msg('请输入详细注册地址');
                e.stopPropagation();
                return false;
            } else {
                // var reg=/^(?=.*?[\u4E00-\u9FA5])/;
                var address = $('#invoice_address').val();
                if (!/^(?=.*?[\u4E00-\u9FA5])/.test(address)) {
                    var a = $('#invoice_address').offset().top;
                    $("html,body").animate({scrollTop: a}, 'slow');
                    layer.msg('注册地址不能全为数字或字母');
                    e.stopPropagation();
                    return false;
                }
                if ($.trim(address).length < 6 || $.trim(address).length > 60) {
                    var a = $('#invoice_address').offset().top;
                    $("html,body").animate({scrollTop: a}, 'slow');
                    layer.msg('注册地址必须为6-60个字符');
                    e.stopPropagation();
                    return false;
                }
            }

            if (!$('#invoice_tel').val()) {
                var a = $('#invoice_tel').offset().top;
                $("html,body").animate({scrollTop: a}, 'slow');
                layer.msg('请输入注册电话');
                e.stopPropagation();
                return false;
            } else {
                var invoice_tel = $('#invoice_tel').val();
                if (!/^0\d{2,3}-?\d{7,8}(-\d{1,8})?$/.test(invoice_tel)) {
                    var a = $('#invoice_tel').offset().top;
                    $("html,body").animate({scrollTop: a}, 'slow');
                    layer.msg('注册电话格式输入错误，请核对！');
                    return false;
                }
                if ($.trim(invoice_tel).length < 11 || $.trim(invoice_tel).length > 20) {
                    var a = $('#invoice_address').offset().top;
                    $("html,body").animate({scrollTop: a}, 'slow');
                    layer.msg('注册电话格式输入错误，请核对！');
                    e.stopPropagation();
                    return false;
                }

            }
            if (!$('#invoice_bank').val()) {
                var a = $('#invoice_bank').offset().top;
                $("html,body").animate({scrollTop: a}, 'slow');
                layer.msg('请输入银行名称');
                e.stopPropagation();
                return false;
            } else {
                ///  ^[A-Za-z\(\)（）\x{4e00}-\x{9fa5}]+$/u
                //  ^[A-Za-z\u4e00-\u9fa5]+$
                // var reg = '/^[A-Za-z\(\)（）\u4e00-\u9fa5]+$/';  //中文和字母
                var bank = $('#invoice_bank').val();
                if (!/^[A-Za-z\(\)（）\u4e00-\u9fa5]+$/.test(bank)) {
                    var a = $('#invoice_bank').offset().top;
                    $("html,body").animate({scrollTop: a}, 'slow');
                    layer.msg('银行名称格式输入错误，请核对！');
                    e.stopPropagation();
                    return false;
                }
                if ($.trim(bank).length < 6 || $.trim(bank).length > 30) {
                    var a = $('#invoice_bank').offset().top;
                    $("html,body").animate({scrollTop: a}, 'slow');
                    layer.msg('银行名称必须为6-30个字符');
                    e.stopPropagation();
                    return false;
                }
            }

            if (!$('#invoice_account').val()) {
                var a = $('#invoice_account').offset().top;
                $("html,body").animate({scrollTop: a}, 'slow');
                layer.msg('请输入银行账户');
                e.stopPropagation();
                return false;
            } else {
                var account = $('#invoice_account').val();
                // var reg=/^[1-9][0-9]*$/;
                //tmptxt.replace(/\D|^0/g,'')
                if (!/^[1-9][0-9]*$/.test(account)) {
                    var a = $('#invoice_account').offset().top;
                    $("html,body").animate({scrollTop: a}, 'slow');
                    layer.msg('银行账户格式输入错误，请核对！');
                    e.stopPropagation();
                    return false;
                }
                if ($.trim(account).length < 8 || $.trim(account).length > 30) {
                    var a = $('#invoice_account').offset().top;
                    $("html,body").animate({scrollTop: a}, 'slow');
                    layer.msg('银行账户必须为8-30个字符');
                    e.stopPropagation();
                    return false;
                }
            }
        }
        if ($('#zzspt_id').is(':checked')) {
            if (!$('#invoice_company_name').val()) {
                var a = $('#invoice_company_name').offset().top;
                $("html,body").animate({scrollTop: a}, 'slow');
                layer.msg('请输入单位名称');
                e.stopPropagation();
                return false;
            } else {
                // var reg = '/^[A-Za-z0-9\_\-\()\（）\u4e00-\u9fa5]+$/';//中文，英文和数字
                var name = $('#invoice_company_name').val();
                var company_name = $.trim(name).length;
                if (!/^[A-Za-z0-9_\-\(\)（）\u4e00-\u9fa5]+$/.test(name)) {
                    var a = $('#invoice_company_name').offset().top;
                    $("html,body").animate({scrollTop: a}, 'slow');
                    layer.msg('单位名称请输入中英文，数字,"-","_","（）","()"的组合');
                    e.stopPropagation();
                    return false;
                }
                if (company_name < 3 || company_name > 60) {
                    var a = $('#invoice_company_name').offset().top;
                    $("html,body").animate({scrollTop: a}, 'slow');
                    layer.msg('单位名称请输入3-60个字符');
                    e.stopPropagation();
                    return false;
                }
            }

            if (!$('#invoice_code').val()) {
                var a = $('#invoice_code').offset().top;
                $("html,body").animate({scrollTop: a}, 'slow');
                layer.msg('请输入纳税人识别码');
                e.stopPropagation();
                return false;
            } else {
                // var reg = '/^[a-zA-Z0-9]+$/';  //数字和字母
                var invoice_code = $('#invoice_code').val();
                if (!/^[a-zA-Z0-9]+$/.test(invoice_code)) {
                    var a = $('#invoice_code').offset().top;
                    $("html,body").animate({scrollTop: a}, 'slow');
                    layer.msg('识别码格式输入错误，请核对！');
                    e.stopPropagation();
                    return false;
                }
                var code = $.trim(invoice_code).length;
                // console.log(code);
                if (code !== 15 && code !== 18 && code !== 20) {
                    var a = $('#invoice_code').offset().top;
                    $("html,body").animate({scrollTop: a}, 'slow');
                    layer.msg('识别码格式输入错误，请核对！');
                    e.stopPropagation();
                    return false;
                }
            }
        }

        // if (!$('#demo1').attr('src')) {
        //     var a = $('#demo1').offset().top;
        //     $("html,body").animate({scrollTop: a}, 'slow');
        //     layer.msg('营业执照必须上传');
        //     e.stopPropagation();
        //     return false;
        // }

        // if (!$('#demo2').attr('src')) {
        //     var a = $('#demo2').offset().top;
        //     $("html,body").animate({scrollTop: a}, 'slow');
        //     layer.msg('法人身份证照片必须上传');
        //     e.stopPropagation();
        //     return false;
        // }

    });

    function change_param() {
        // $("#province").val($("#city-picker1").data("citypicker").getValue('province'));
        // $("#city").val($("#city-picker1").data("citypicker").getValue('city'));
        // $("#district").val($("#city-picker1").data("citypicker").getValue('district'));
        //
        // $("#shipping_province").val($("#city-picker2").data("citypicker").getValue('province'));
        // $("#shipping_city").val($("#city-picker2").data("citypicker").getValue('city'));
        // $("#shipping_district").val($("#city-picker2").data("citypicker").getValue('district'));

    }
</script>


</body>
</html>
